Skip to content

feat: Support for tracing ID headers#107

Merged
Anush008 merged 1 commit into
custom-headersfrom
tracing-ids
May 7, 2026
Merged

feat: Support for tracing ID headers#107
Anush008 merged 1 commit into
custom-headersfrom
tracing-ids

Conversation

@Anush008
Copy link
Copy Markdown
Member

@Anush008 Anush008 commented Mar 18, 2026

Built on top of #106

Context ctx = RequestHeaders.withHeader(Context.current(), "x-request-id", "abc-123");
ctx.run(() -> client.listCollectionsAsync());
Map<String, String> headers = new HashMap<>();
headers.put("x-request-id", "abc-123");
headers.put("x-tenant-id", "org-456");

Context ctx = RequestHeaders.withHeaders(Context.current(), headers);
ctx.run(() -> {
    client.upsertAsync("my-collection", points);
    client.queryAsync("my-collection", searchRequest, 10);
    // both carry x-request-id
});

static ClientInterceptor newInterceptor() {
return new ClientInterceptor() {
@Override
public <ReqT, RespT> ClientCall<ReqT, RespT> interceptCall(
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No way around this boilerplate 🙁

Signed-off-by: Anush008 <mail@anush.sh>
@Anush008 Anush008 merged commit 7402802 into custom-headers May 7, 2026
3 checks passed
@Anush008 Anush008 deleted the tracing-ids branch May 7, 2026 08:41
@Anush008 Anush008 mentioned this pull request May 11, 2026
Anush008 added a commit that referenced this pull request May 11, 2026
Signed-off-by: Anush008 <mail@anush.sh>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants